package com.lovegu.object.up;

/**
 * @author 老顾
 * @title: Preson
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/20 16:51
 */
public class Person {
    //属性，成员变量
    String name;
    int age;
    boolean isMarried;
    //构造器
    public void Person(){}
    public void Person(String n, boolean im){
        name = n;isMarried = im;
    }
    //方法或函数
    public void walk(){
        System.out.println("人走路...");
    }
    public String display(){
        return "名字是:"+name+"年龄是:"+age+"Merried:"+isMarried;
    }
    //代码块
    {
        name = "韩梅梅";
        age = 19;
        isMarried = true;
    }

    public void shout() {
        System.out.println("闭嘴");
    }

    //内部类
    class pet{
        String name;
        float weight;
    }
}
